const mysql = require('mysql')

const conn = mysql.createConnection({
    host: "81.70.91.139",//主机名（服务器地址）
    port: '3306',
    user: "zhoushihao",//用户名
    password: "zsh@1234",//密码
    database: "zhoushihao" //数据库名字
});

conn.connect();  //连接数据库

let sql = "delete from person where username='zsh'";

conn.query(sql, (err, result) => {
    if (err) {
        console.log(err);
        return;
    }
    //判断delete语句是否执行成功
    if (result.affectedRows != 0) {
        console.log("删除成功！");
    } else {
        console.log("删除失败！");
    }
    // console.log(result);
})

conn.end();  //断开链接

